<link rel="stylesheet" href="/js/editor.md/css/editormd.css"/>

<fieldset class="solid">
	<input type="hidden" name="blog.id" value="#(blog.id??)" />

	<div class="form-group">
		<label for="title">标题</label>
		<input type="text" class="form-control" id="title" name="blog.title"  value="#(blog.title??)" maxlength="200" placeholder="请输入标题">
	</div>

	<div class="form-group">
		<label for="title">摘要</label>
		<textarea class="form-control" rows="3" id="describe" name="blog.describe" style="resize:none;" maxlength="250" placeholder="请输入摘要">#(blog.describe??)</textarea>
	</div>

	<div class="form-group">
		<label for="keyWord">关键字</label>
		<input type="text" class="form-control" id="keyWord" name="blog.keyWord" value="#(blog.keyWord??)" maxlength="200" placeholder="请输入关键字,多个按英文逗号隔开">
	</div>

	<div>
		<label>内容</label>
		<div id="content-editormd">
			<textarea style="display:none;" name="blog.content">#(blog.content??)</textarea>
		</div>
	</div>

	<div class="form-group">
		<div class="radio">
			<label>
				<input type="radio" name="blog.state" id="optionsRadios1" value="1" checked>
				发布状态
			</label>
		</div>
		<div class="radio">
			<label>
				<input type="radio" name="blog.state" id="optionsRadios2" value="2">
				草稿状态
			</label>
		</div>

		<!--<input type="text" class="form-control" id="state" name="blog.state" value="#(blog.state??)" placeholder="">-->
	</div>

	<div class="form-group">
		<label>操作</label>
		<div>
			<input class="btn btn-primary" type="submit" value="提交">
			<input class="btn btn-default" type="button" onclick="history.go(-1)" value="返回">
		</div>
	</div>
</fieldset>

<script src="/js/editor.md/editormd.js"></script>
<script>
    var testEditor;
    $(document).ready(function () {
        //设置单选框状态
		function checkoptionsRadios(){
            if('#(blog.state??1)' !== '1'){
                $("#optionsRadios2").attr("checked",true);
            }
		}
        checkoptionsRadios();

        testEditor = editormd("content-editormd", {
            width: "100%",
            height: 720,
            syncScrolling: "full",
            path: "/js/editor.md/lib/",
            codeFold: true,
            saveHTMLToTextarea: true,
            searchReplace: true,
            toolbar: true,
            imageUpload: true,
            imageUploadURL: "/f/uploadEditor",
            onload: function () {

            }
        });
    });
</script>